package com.cjh.db2doc;

import com.cjh.db2doc.conn.DataSourceConfig;
import java.sql.SQLException;

/**
 * com.cjh.db2doc 2022/7/26 10:23
 *
 * @author chenjh
 */
public class Main {

    public static void main(String[] args) throws Exception {
        DataSourceConfig dataSourceConfig = new DataSourceConfig();
        dataSourceConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
        dataSourceConfig.setJdbcUrl(
                "jdbc:mysql://tdsqlshard-2efitvsf.sql.tencentcdb.com:38/citycode_engine_sd?characterEncoding=utf8&useSSL=false&useUnicode=true&serverTimezone=GMT%2B8");
        dataSourceConfig.setUsername("jkm");
        dataSourceConfig.setPassword("Jkm..Boss>2021");
        dataSourceConfig.setDbname("citycode_engine_sd");
//        dataSourceConfig.setJdbcUrl(
//                "jdbc:mysql://localhost:3306/test?useInformationSchema=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai");
//        dataSourceConfig.setUsername("root");
//        dataSourceConfig.setPassword("123456");
//        dataSourceConfig.setDbname("test");
        GeneratorConfig generatorConfig = new GeneratorConfig();
        generatorConfig.setDataSourceConfig(dataSourceConfig);
        DbExportEngine dbExportEngine = new DbExportEngine();
        dbExportEngine.setGeneratorConfig(generatorConfig);
        dbExportEngine.generator();
    }
}
